package com.ssy.lingxi.member.merchant.controller.web;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.basic.request.MemberHistoryPageVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.MemberInnerHistoryDetailVO;
import com.ssy.lingxi.member.merchant.model.vo.basic.response.MemberOuterHitoryDetailVO;
import com.ssy.lingxi.member.merchant.service.web.IPlatformMemberHistoryService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu 平台后台 - 日志中心相关接口
 * @author 万宁
 * @version 2.0.0
 * @date 2021-12-04
 */
@RestController
@RequestMapping("/member/history")
public class PlatformMemberHistoryController {
    @Resource
    private IPlatformMemberHistoryService platformMemberHistoryService;

    /**
     * 分页查询外部流转记录
     * @param headers HttpHeaders信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/outer/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberOuterHitoryDetailVO>> findOuterHistories(@RequestHeader HttpHeaders headers, @Valid MemberHistoryPageVO pageVO) {
        return platformMemberHistoryService.findOuterHistories(headers, pageVO);
    }

    /**
     * 分页查询内部流转记录
     * @param headers HttpHeaders信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/inner/page", method = RequestMethod.GET)
    public Wrapper<PageData<MemberInnerHistoryDetailVO>> findInnerHistories(@RequestHeader HttpHeaders headers, @Valid MemberHistoryPageVO pageVO) {
        return platformMemberHistoryService.findInnerHistories(headers, pageVO);
    }
}
